﻿using System;

namespace XTengine.ComponentModel
{
    public class BoolConverter : TypeConverter<Boolean>
    {
        public override Boolean ConvertFrom(string value)
        {
            Boolean result;
            if (Boolean.TryParse(value, out result))
            {
                return result;
            }

            return false;
        }

        public override string ConvertTo(Boolean value)
        {
            return value.ToString();
        }
    }
}